/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package unidad_3;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

/**
 *
 * @author jcverdia
 */
public class Botones {
    public static void main(String[] args) {
        Frame f=new Frame();

        f.setLayout(new GridLayout(4,4));// crea una tabla..

        Panel p1=new Panel();
        p1.setLayout(new GridLayout(2,2));// crea una tabla..

        Button b1=new Button("1");
        Button b2=new Button("2");
        Button b3=new Button("3");
        Button b4=new Button("4");
        p1.add(b1);
        p1.add(b2);
        p1.add(b3);
        p1.add(b4);

        f.add(p1);


        Panel p2=new Panel();
        p2.setLayout(new GridLayout(2,1));// crea una tabla..

        Button b5=new Button("5");
        Button b6=new Button("6");

        p2.add(b5);
        p2.add(b6);

        f.add(p2);

        Panel p3=new Panel();
        p3.setLayout(new GridLayout(3,1));// crea una tabla..

        Button b7=new Button("7");
        Button b8=new Button("8");
        Button b9=new Button("9");

        p3.add(b7);
        p3.add(b8);
        p3.add(b9);


        f.add(p3);

        Panel p4=new Panel();
        p4.setLayout(new GridLayout(2,2));// crea una tabla..

        Button b10=new Button("10");
        Button b11=new Button("11");
        Button b12=new Button("12");
        Button b13=new Button("13");
        p4.add(b10);
        p4.add(b11);
        p4.add(b12);
        p4.add(b13);

        f.add(p4);


         Panel p5=new Panel();
        p5.setLayout(new GridLayout(3,1));// crea una tabla..

        Button b14=new Button("14");
        Button b15=new Button("15");
        Button b16=new Button("16");

        p5.add(b14);
        p5.add(b15);
        p5.add(b16);


        f.add(p5);

        Panel p6=new Panel();
        p6.setLayout(new GridLayout(1,3));// crea una tabla..

        Button b17=new Button("17");
        Button b18=new Button("18");
        Button b19=new Button("19");
        Button b20=new Button("20");
        p6.add(b17);
        p6.add(b18);
        p6.add(b19);
        p6.add(b20);

        f.add(p6);

        Panel p7=new Panel();
        p7.setLayout(new GridLayout(1,3));// crea una tabla..

        Button b21=new Button("17");
        Button b22=new Button("18");
        Button b23=new Button("19");
        Button b24=new Button("20");
        p7.add(b21);
        p7.add(b22);
        p7.add(b23);
        p7.add(b24);

        f.add(p7);

        Panel p8=new Panel();
        p8.setLayout(new GridLayout(3,1));// crea una tabla..

        Button b25=new Button("25");
        Button b26=new Button("26");
        Button b27=new Button("27");

        p8.add(b25);
        p8.add(b26);
        p8.add(b27);


        f.add(p8);

        Panel p9=new Panel();
        p9.setBackground(Color.yellow);
        p9.setLayout(new GridLayout (1,2));

        Button b28=new Button("28");
        Button b29=new Button("29");
        p9.add(b28);
        p9.add(b29);


        f.add(p9);

        Panel p10=new Panel();
        p10.setBackground(Color.CYAN);
         p10.setLayout(new GridLayout(3,1));// crea una tabla..

        Button b30=new Button("30");
        Button b31=new Button("31");
        Button b32=new Button("32");

        p10.add(b30);
        p10.add(b31);
        p10.add(b32);

        f.add(p10);

        Panel p11=new Panel();

        p11.setBackground(Color.CYAN);
         p11.setLayout(new GridLayout(3,1));// crea una tabla..

        Button b33=new Button("33");
        Button b34=new Button("34");
        Button b35=new Button("35");

        p11.add(b33);
        p11.add(b34);
        p11.add(b35);

        f.add(p11);

        Panel p12=new Panel();


        p12.setBackground(Color.yellow);
        p12.setLayout(new GridLayout (1,2));

        Button b36=new Button("36");
        Button b37=new Button("37");
        p12.add(b36);
        p12.add(b37);

        f.add(p12);

        Panel p13=new Panel();

         p13.setBackground(Color.yellow);
        p13.setLayout(new GridLayout (1,2));

        Button b39=new Button("39");
        Button b40=new Button("40");
        p13.add(b39);
        p13.add(b40);

        f.add(p13);


        Panel p14=new Panel();
        p14.setLayout(new GridLayout(3,1));

            Panel pA1=new Panel();
            pA1.setLayout(new GridLayout(1,3));
            Button b41=new Button("41");
            Button b42=new Button("42");
            Button b43=new Button("43");
            pA1.add(b41);
            pA1.add(b42);
            pA1.add(b43);
        p14.add(pA1);


        Panel pA2=new Panel();
            pA2.setLayout(new GridLayout(1,2));
            Button b44=new Button("44");
            Button b45=new Button("45");

            pA2.add(b44);
            pA2.add(b45);

        p14.add(pA2);

        Panel pA3=new Panel();
            pA3.setLayout(new GridLayout(1,3));
            Button b46=new Button("46");
            Button b47=new Button("47");
            Button b48=new Button("47");
            pA3.add(b46);
            pA3.add(b47);
            pA3.add(b48);
        p14.add(pA3);




        f.add(p14);

        Panel p15=new Panel();

       p15.setLayout(new GridLayout(3,1));

            Panel pB1=new Panel();
            pB1.setLayout(new GridLayout(1,3));
            Button b49=new Button("49");
            Button b50=new Button("50");
            Button b51=new Button("51");
            pB1.add(b49);
            pB1.add(b50);
            pB1.add(b51);
        p15.add(pB1);


        Panel pB2=new Panel();
            pB2.setLayout(new GridLayout(1,2));
            Button b52=new Button("52");
            Button b53=new Button("53");

            pB2.add(b52);
            pB2.add(b53);

        p15.add(pB2);

        Panel pB3=new Panel();
            pB3.setLayout(new GridLayout(1,3));
            Button b54=new Button("54");
            Button b55=new Button("55");
            Button b56=new Button("56");
            pB3.add(b54);
            pB3.add(b55);
            pB3.add(b56);
        p15.add(pB3);



        f.add(p15);

        Panel p16=new Panel();

         p16.setBackground(Color.yellow);
        p16.setLayout(new GridLayout (1,2));

        Button b57=new Button("57");
        Button b58=new Button("58");
        p16.add(b57);
        p16.add(b58);

        f.add(p16);

        f.setSize(500, 500);
        f.setVisible(true);




    f.addWindowListener( new WindowAdapter(){
    public void windowClosing(WindowEvent ev){
        System.exit(0);
    }
    });











    }

}
